<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>节点管理</title>
    <%@ include file="/common/util.jsp" %>
    <script type="text/javascript">
        //翻页
        function jumpPage(pageNo) {
            window.location.href = "${cdnctx }/systemAreaPoint/areaPointList.shtml?" + $.param($("#AreaPointForm").serializeObject()) + "&pageIndex=" + pageNo;
        }

        function add() {
            window.location.href = "${cdnctx }/systemAreaPoint/areaPointEdit.shtml?areaid=" + ${customerArea.id } ;
        }

        function update(id,aid ) {
            window.location.href = "${cdnctx}/systemAreaPoint/areaPointEdit.shtml?id=" + id + "&areaid=" + aid;
        }

        function todelete(pointid, areaid, customerinfoid) {
            dialog_confirmled("确定删除吗？", function () {
                window.location.href = "${cdnctx}/systemAreaPoint/delAreaPoint.shtml?pointid=" + pointid + "&areaid=" + areaid ;
            });
        }
    </script>
</head>

<body class="main">
<div class="-frame -style -luster" id="css_container">

    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">

        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->
        <form id="customerInfoForm1">
            <input type="hidden" id="lng" name="lng" value="1"/>
            <input type="hidden" id="lat" name="lat" value="2"/>
        </form>
        <div class="main-mid">
            <div class="pos"><img src="${cdnctx}/src/index/img/index.png"><a href="<%--${cdnctx}/system/systemMenu.shtml--%>">系统管理 </a>
                ><a href="${cdnctx}/system/customerinfo/customerMain.shtml">公司信息管理</a>
                ><a href="${cdnctx}/systemCustomerArea/customerAreaList.shtml?customerinfoid=${customerArea.customerinfoid }">${customerArea.companyname }</a>
                ><a>${customerArea.areaname }_节点管理</a>
            </div>
            <div class="css_contentDiv">
                <form action="${cdnctx}/systemAreaPoint/areaPointList.shtml" method="post" id="AreaPointForm">
                    <div class="searchArea" style="padding:10px;">
                        <input type="hidden" name="customerinfoid" value="${customerInfo.id  }"/>
                        <input type="hidden" name="areaid" value="${customerArea.id }"/>
                        <label class="search_text">节点名称:&nbsp;</label>
                        <input type="text"
                               id="pointname" name="pointname" class="search_input" value="${areaPoint.pointname }">
                        <input type="submit" class="search_btn" value="查&nbsp;询">
                        <input type="button" class="add_btn" onclick="add();" value="新&nbsp;增"/>
                    </div>
                </form>
                <div id="detailDiv" class="detailDiv">
                    <table id="sjxs" class="list_table">
                        <thead>
                        <tr>
                            <td>序号</td>
                            <td>节点名称</td>
                            <td>网关</td>
                            <td>设备</td>
                            <td>通道</td>
                            <td>设备类型</td>
                            <td>功率（W）</td>
                            <td>设备管理</td>
                            <td>操&nbsp;&nbsp;&nbsp;作</td>
                        </tr>
                        </thead>
                        <c:if test="${empty(AreaPoints) }">
                            <tr class="even" style="color:red">
                                <td colspan="10" class="no-data" style="height: 280px;"></td>
                            </tr>
                        </c:if>
                        <c:if test="${not empty(AreaPoints) }">
                            <tbody>
                            <c:forEach items="${AreaPoints}" var="entity" varStatus="status">
                                <tr>
                                    <td>${status.index+1 }</td>
                                    <td>${entity.pointname}</td>
                                    <td>${entity.gatewayid}</td>
                                    <td>${entity.sensorid}</td>
                                    <td>${entity.channelid}</td>
                                    <td>${entity.devicetypename}</td>
                                    <td>${entity.realpower}</td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${entity.devicetypeid==418 }">
                                                <a href='${cdnctx }/systemPointLight/PointLightList.shtml?pointid=${entity.id}'>操作</a>
                                            </c:when>
                                            <c:otherwise>
                                                <a href='${cdnctx }/systemPointAir/pointAirList.shtml?pointid=${entity.id }'>操作</a>
                                            </c:otherwise>
                                        </c:choose>
                                    </td>
                                    <td width="120px;" nowrap="">
                                        <input type="button" class="list_update_btn"
                                               onclick="update(${entity.id}, ${customerArea.id });" value="修改">
                                        <input type="button" class="list_delete_btn"
                                               onclick="todelete(${entity.id },${customerArea.id} , ${customerInfo.id });"
                                               value="删除">
                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </c:if>
                    </table>
                    <br style="clear:both;">
                </div>
                <c:if test="${not empty(AreaPoints) }">
                    <div id="pageInfo" class="pageJump">
                        <script type="text/javascript">
                            pagination.getPaginationHtml('JavaScript:jumpPage({0})', ${pageIndex}, ${pageCount}, 'pageInfo');
                        </script>
                        共有${dataCount}条数据
                    </div>
                </c:if>
            </div>
        </div>
    </div>
    <!--首页框架页尾部分↓-->
    <%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
    <!--首页框架页尾部分↑-->
</div>
</body>
</html>